﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace Web_Oto.Linq
{
    public interface IRepository<T> : IDisposable where T : class, Identifiable
    {
        void Add(T entity);
        void Remove(T entity);
        void Remove(IEnumerable<T> collection);
        void RemoveByFilter(Expression<Func<T, bool>> filter);
        T GetById(int id);
        IQueryable<T> GetByFilter(Expression<Func<T, bool>> filter);
        void Save();
        IQueryable<T> GetAll();
    }
}
